<?php


namespace EchoPHP\Database\Connections;


use PDO;

class MysqlConnection extends PdoConnection {

    /**
     * 绑定变量到pdostatement float类型也当做 PARAM_INT型的数据
     * @param $statement
     * @param $bindings
     */
    public function bindValuesToPDOStatement($statement, $bindings) {
        foreach ($bindings as $key => $value) {
            $statement->bindValue(
                is_string($key) ? $key : $key + 1, $value,
                is_int($value) || is_float($value) ? PDO::PARAM_INT : PDO::PARAM_STR
            );
        }
    }
}